import 'dart:convert';

import 'package:ichinesereader/models/book/MostReadBook.dart';

MostReadBooksResult mostReadBooksResultFromJson(String str) => MostReadBooksResult.fromJson(json.decode(str));

String mostReadBooksResultToJson(MostReadBooksResult data) => json.encode(data.toJson());

class MostReadBooksResult {
    MostReadBooksResult({
        this.status,
        this.message,
        this.result,
    });

    int? status;
    String? message;
    Result? result;

    factory MostReadBooksResult.fromJson(Map<String, dynamic> json) => MostReadBooksResult(
        status: json["status"],
        message: json["message"],
        result: json["result"]!=null ? Result.fromJson(json["result"]) : null,
    );

    Map<String, dynamic> toJson() => {
        "status": status,
        "message": message,
        "result": result!=null ? result?.toJson() : null,
    };
}

class Result {
    Result({
        this.subResult,
    });

    List<MostReadBook>? subResult;

    factory Result.fromJson(Map<String, dynamic> json) => Result(
        subResult: json["subResult"]!=null ? List<MostReadBook>.from(json["subResult"].map((x) => MostReadBook.fromJson(x))) : null,
    );

    Map<String, dynamic> toJson() => {
        "subResult": subResult!=null ? List<dynamic>.from(subResult!.map((x) => x.toJson())) : null,
    };
}